package com.yupi.yuoj.service;

import com.yupi.yuoj.model.dto.membership.MembershipPurchaseRequest;
import com.yupi.yuoj.model.entity.User;
import com.yupi.yuoj.model.vo.MembershipVO;

/**
 * 会员服务
 *
 * @author <a href="https://github.com/liyupi">程序员鱼皮</a>
 * @from <a href="https://yupi.icu">编程导航知识星球</a>
 */
public interface MembershipService {

    /**
     * 获取用户会员信息
     *
     * @param user 用户
     * @return 会员信息
     */
    MembershipVO getUserMembership(User user);

    /**
     * 购买会员
     *
     * @param purchaseRequest 购买请求
     * @param user 用户
     * @return 是否成功
     */
    boolean purchaseMembership(MembershipPurchaseRequest purchaseRequest, User user);

    /**
     * 检查并更新会员状态
     *
     * @param user 用户
     * @return 更新后的用户
     */
    User checkAndUpdateMembershipStatus(User user);
}